//
//  LCAmountListTableViewCell.m
//  lechuang
//
//  Created by Mr_hi on 2023/4/11.
//  Copyright © 2023 Mooyi. All rights reserved.
//

#import "LCAmountListTableViewCell.h"
#import "LCAmountListModel.h"


@interface LCAmountListTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *thumbView;

@property (weak, nonatomic) IBOutlet UILabel *titleLb;

@property (weak, nonatomic) IBOutlet UILabel *addTimeLb;

@property (weak, nonatomic) IBOutlet UILabel *statusLb;

@property (weak, nonatomic) IBOutlet UILabel *remarkLb;

@end


@implementation LCAmountListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

-(void)setAmount:(LCAmountListModel *)amount {
    _amount = amount;
    
    switch (self.affairs) {
        case 0: {
            //全部
            self.statusLb.hidden = YES;
            self.titleLb.text = amount.remark;
            [self.thumbView sd_setImageWithURL:[LCFunction XWX_URLImg:amount.formthumb]];
        } break;
        case 1: {
            //任务
            self.statusLb.hidden = YES;
            self.titleLb.text = kFORMAT(@"完成%@获得%@元",amount.appname,amount.amount);
            [self.thumbView sd_setImageWithURL:[LCFunction XWX_URLImg:LCUserDefGet(UserImg)]];
        } break;
        default: {
            //提现
            self.statusLb.hidden = NO;
            if ([amount.affairs integerValue] == 0) {
                self.statusLb.text = @"等待处理";
                self.statusLb.textColor = [UIColor colorWithHexString:@"#36C574"];
                self.remarkLb.text = @"";
            } else if ([amount.affairs integerValue] == 255) {
                self.statusLb.text = @"提现成功";
                self.statusLb.textColor = [UIColor colorWithHexString:@"#16A1E3"];
                self.remarkLb.text = @"";
            } else {
                self.statusLb.text = @"提现失败";
                self.remarkLb.text = kFORMAT(@"驳回备注：%@",amount.strremark);
                self.statusLb.textColor = [UIColor colorWithHexString:@"#999999"];
            }
            self.titleLb.text = kFORMAT(@"提现%@元",amount.cashamount);
            [self.thumbView sd_setImageWithURL:[LCFunction XWX_URLImg:LCUserDefGet(UserImg)]];
        } break;
    }
    
    self.addTimeLb.text = amount.addtime;
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
